<template>
  <div>
    <div class="recommend-title">
      <div>旅游攻略</div>
    </div>
    <ul>
      <router-link :to="'/detail/' + item.id" custom v-slot="{ navigate }" v-for="item of recommendList" :key="item.id">
        <li @click="navigate" @keypress.enter="navigate" role="link" class="item border-bottom" >
          <img class="item-img" :src="item.imgUrl">
          <div class="item-info">
            <p class="item-title">{{item.title}}</p>
            <p class="item-desc">{{item.desc}}</p>
            <button class="item-btn">查看详情</button>
          </div>
        </li>
      </router-link>

    </ul>
  </div>

</template>
<script>
export default {
  name: 'HomeRecommend',
  props: {recommendList: Array},
  data () {
    return {
    }
  }
}
</script>
<style lang="stylus" scoped>
@import '~assets/mixins.styl'
  .recommend-title
    margin-top: .2rem
    line-height: .8rem
    background: #eee
    text-indent: .2rem
  .item
    height: 1.9rem
    display: flex
    overflow: hidden
    .item-img
      width 1.7rem
      height: 1.7rem
      padding: .1rem
    .item-info
      min-width: 0
      flex: 1
      padding: .1rem
      .item-title
        line-height: .54rem
        font-size: .32rem
        ellipsis()
      .item-desc
        font-size: .25rem
        line-height: .4rem
        color: #ccc
        ellipsis()
      .item-btn
        line-height: .44rem
        background: #ff9300
        border-radius: .06rem
        margin-top: .1rem
        color: #fff
        font-size: .2rem
        padding: 0 .1rem
</style>
